#include <iostream>
#include <string>
using namespace std;
string s,k;
string s1;
int main()
{
    int n,m;
    cin>>n>>m;
    cin>>s>>k;
    for(int i=0;i<n;i++)
    {
        if(s[i]>='a' && s[i]<='z')
        {
            s1.push_back(s[i]);
        }
    }
    if(s1.find(k)!=string::npos) cout<<"YES";
    else cout<<"NO";
    return 0;
}
